package com.example.module_main.ui.main

import com.example.module_main.http.MainApi
import com.example.module_main.http.MainNetModule
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.flow.flow
import kotlinx.coroutines.flow.flowOn
import javax.inject.Inject


class MainRepository @Inject constructor() {
    @Inject
    @MainNetModule.CommonMainApi
    lateinit var mainApi: MainApi

    /**
     * 版本更新
     */
    fun checkUpdate() = flow {
        emit(mainApi.checkUpdate())
    }.flowOn(Dispatchers.IO)
}